﻿<?php 
// configration
class config {
    // checking element
    static $debug = true;
    // supported characters unicode
    static $encoding = 'UTF-8';
    // enable validation using javascript
    static $JScript = true;
    // javascript framwork path
    static $JScriptLibPath = 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js';
    // vars
    static $DELETEsign = 'DELETE';
    static $FALSEsign = 'FALSE';
    static $childsign = '.';
    // errors messages
    static $messages = 
	array(
        'required'=>'This field is required.',
        'minlength'=>'Please enter a value greater than or equal to {{{length.minlength}}}.',
        'maxlength'=>'Please enter a value less than or equal to {{{length.maxlength}}}.',
        'range'=>'Please enter a value between {{{range.from}}} and {{{range.to}}}.',
        'regex'=>'Please enter a valid {{{name}}}.',
        'compare-equal'=>'Please enter the same value again.',
        'compare-notEqual'=>'Please this field {{{name}}} is equel to this element {{{compare.with}}}.'
    );
    // regular expression patterns
    static $regex = 
	array(
		'arabic'=>'/[\x{621}-\x{6FF} ]+/u',
		'english'=>'/[A-Za-z ]+/u',
		'englsihPlusNumbers'=>'/^[A-Za-z0-9 ]+$/',
		'number'=>'/^[0-9 ]+$/',
		'username'=>'/^[A-Za-z]+[0-9]*([_]?[A-Za-z]+)*$/',
		'address'=>'/^[0-9 \x{621}-\x{6FF}]+|[A-Za-z0-9 ]+$/u',
		'email'=>'/^[a-zA-Z0-9]{1,15}[_\.\-]?[a-zA-Z0-9]{1,15}@[a-zA-Z0-9]{2,15}[\.\-]?[a-zA-Z0-9]{2,5}([\.]?[a-zA-Z]{2,5})?$/'
        );
}
?>
